<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap{
	protected function _initDoctype(){
		$this->bootstrap('view');
		$view = $this->getResource('view');
		$view->doctype('XHTML1_STRICT');
	}
	protected function _initActionHelper(){
		Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH .'/controllers/helpers');
	}
	protected function _initAutoloadRessource(){
		$ressourceLoader = new Zend_Loader_Autoloader_Resource(array(
			'namespace' => 'Application',
			'basePath'  => dirname(__FILE__),
		));
		$ressourceLoader->addResourceType('form', 'forms/', 'Form')
						->addResourceType('acl', 'acls/', 'Acl')
						->addResourceType('model', 'models/', 'Model')
						->addResourceType('plugin', 'plugins/', 'Plugin');
	 
		return $ressourceLoader;
	}
	protected function _initAcl(){
		$acl = new Application_Acl_DefaultAcl();
		Zend_Controller_Front::getInstance()->registerPlugin(new Application_Plugin_Acl());
		Zend_View_Helper_Navigation_HelperAbstract::setDefaultAcl($acl);
		$auth = Zend_Auth::getInstance();
		$role = (!$auth->hasIdentity()) ? 'guest' : $auth->getIdentity()->role;
	}
}

